<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>团购活动 - Powered by wemall</title>
<meta name="keywords" content="$!config.keywords" />
<meta name="description" content="$!config.description" />
<meta name="generator" content="wemall 2.0" />
<meta name="author" content="www.wemall.com">
<meta name="copyright" content="wemall Inc. All Rights Reserved">
<link href="$!webPath/resources/style/system/front/default/css/public.css" type="text/css" rel="stylesheet" />
<link href="$!webPath/resources/style/system/front/default/css/user.css" type="text/css" rel="stylesheet" />
<link href="$!webPath/resources/style/common/css/overlay.css" type="text/css" rel="stylesheet" />
<script src="$!webPath/resources/js/jquery-1.8.3.min.js"></script>
<script src="$!webPath/resources/js/jquery-ui-1.8.21.js"></script>
<script src="$!webPath/resources/js/jquery.shop.common.js"></script>
<script src="$!webPath/resources/js/jquery.validate.min.js"></script>
<script charset="utf-8" src="$!webPath/resources/editor/kindeditor.js"></script>
<script charset="utf-8" src="$!webPath/resources/editor/lang/zh_CN.js"></script>
<script>
var options = {
        cssPath : '$!webPath/resources/editor/plugins/code/prettify.css',
        filterMode : true,
		uploadJson:'$!webPath/upload.htm',
		width : '600px',
		height:'400px',
		resizeType : 1,
		allowImageUpload : false,
		allowFlashUpload : false,
		allowMediaUpload : false,
		allowFileManager : false,
		syncType:"form",
		afterCreate : function() {
							var self = this;
							self.sync();
						},
		afterChange : function() {
							var self = this;
							self.sync();
						},
		afterBlur : function() {
							var self = this;
							self.sync();
						},
		items:['source', '|', 'fullscreen', 'undo', 'redo', 'print', 'cut', 'copy', 'paste',
			'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
			'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
			'superscript', '|', 'selectall', 'clearhtml','quickformat','|',
			'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
			'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image','flash', 'media', 'baidumap','table', 'hr', 'emoticons', 'link', 'unlink', '|', 'about']
}; 
jQuery(document).ready(function(){
	editor = KindEditor.create('#gg_content',options); 
	//
     jQuery("#theForm").validate({
       rules: {
		    group_id:{required:true},
			gg_name:{required:true},
			goods_name:{required:true},
			gg_price:{required:true,number:true},
			gg_count:{required:true,digits:true},
			gc_id:{required:true},
			ga_id:{required:true},
			gg_group_count:{required:true,digits:true},
			gg_vir_count:{digits:true},
			gg_min_count:{digits:true},
			gg_acc:{#if(!$!obj.gg_img)required:true,#end accept:"$!config.imageSuffix"},
			gc_agree:{required:true}
		  },
	   messages: {
		    group_id:{required:"团购活动不能为空"},
		    gg_name:{required:"团购名称不能为空"},
			goods_name:{required:"团购商品不能为空"},
			gg_price:{required:"团购价格不能为空",number:"团购价格只能为数字"},
			gg_count:{required:"团购数量不能为空",digits:"团购数量只能为整数"},
			gc_id:{required:"团购分类不能为空"},
			ga_id:{required:"团购区域不能为空"},
			gg_group_count:{required:"成团数量不能为空",digits:"成团数量只能为整数"},
			gg_vir_count:{digits:"虚拟数量只能为整数"},
			gg_min_count:{digits:"限购数量只能为整数"},
			gg_acc:{#if(!$!obj.gg_img)required:"团购图片不能为空",#end accept:"图片格式只能为$!config.imageSuffix"},
			gc_agree:{required:"请接收团购协议"}
		}
  });
  jQuery("#group_id").val("$!obj.group.id");
  jQuery("#gc_id").val("$!obj.gg_gc.id");
  #if("$!{obj.gg_ga.id}"=="")
  jQuery("#ga_id").val("-1");
  #else
  jQuery("#ga_id").val("$!obj.gg_ga.id");
  #end
});
</script>
</head>
<body>
$!httpInclude.include("/top.htm")
<div class="main"> $!httpInclude.include("/seller/nav_head.htm")
  <div class="user_center">
    <table width="1200" border="0" cellspacing="0" cellpadding="0" class="user_table">
      <tr>
       $!httpInclude.include("/seller/nav.htm?op=group")
        <td id="centerbg" valign="top">
         <div class="buyer_position"><div class="buyer_p_box"><a href="$!webPath/seller/index.htm">卖家中心</a> > <span>新增团购商品</span></div></div>
        <div class="productmain">
          <div class="ordernav">
              <ul class="orderul">
                <li><a href="$!webPath/seller/group.htm">团购商品列表</a></li>
                <li class="this">新增团购商品</li>
              </ul>
            </div>
          <div class="ordercon">
            <form action="$!webPath/seller/group_goods_save.htm" method="post" enctype="multipart/form-data" name="theForm" id="theForm">
                <table width="705" border="0" cellspacing="0" cellpadding="0" class="addnavtable">
                  <tr>
                    <td width="15%" align="right" valign="top">团购活动：</td>
                    <td width="90%" class="px10 message">
                    <select name="group_id" id="group_id">
                    #foreach($group in $groups)
                    #set($time="$!CommUtil.formatTime('yyyy年MM月dd日 HH:mm',$!{group.beginTime}) - $!CommUtil.formatTime('yyyy年MM月dd日 HH:mm',$!{group.endTime})")
                    <option value="$!group.id">$!group.group_name[$!time]</option>
                    #end
                    </select>
<input name="id" type="hidden" id="id" value="$!obj.id" /></td>
                  </tr>
                  
                  <tr>
                    <td align="right" valign="top"> 团购名称：</td>
                    <td class="px10"><input name="gg_name" type="text" id="gg_name" style="height:25px;" value="$!obj.gg_name" size="40" /></td>
                  </tr>
                  <tr>
                    <td align="right" valign="top"> 团购商品：</td>
                    <td class="px10"><input name="goods_name" type="text" id="goods_name" style="height:25px;" value="$!obj.gg_goods.goods_name" size="40" readonly="readonly" dialog_uri="$!webPath/seller/group_goods.htm" dialog_title="选择团购商品" dialog_width="450" dialog_height="200" dialog_id="group_goods" />
                      <input name="goods_id" type="hidden" id="goods_id" value="$!obj.gg_goods.id" /></td>
                  </tr>
                  <tr id="store_price" style="display:none;">
                    <td align="right" valign="top">商品价格：</td>
                    <td class="px10" id="store_price_info">&nbsp;</td>
                  </tr>
                  <tr id="store_inventory" style="display:none;">
                    <td align="right" valign="top">商品库存：</td>
                    <td class="px10" id="store_inventory_info">&nbsp;</td>
                  </tr>
                  <tr>
                    <td align="right" valign="top"> 团购价格：</td>
                    <td class="px10"><input name="gg_price" type="text" id="gg_price" style="height:25px;" value="$!obj.gg_price" size="40" />
                    团购价格应包含邮费，团购商品系统默认不收取邮费</td>
                  </tr>
                  #if($!obj)
                   <tr>
                     <td align="right" valign="top"> 当前图片：</td>
                     <td class="px10"><img src="$!webPath/$!obj.gg_img.path/$!obj.gg_img.name" width="150" height="150" /></td>
                   </tr>
                   #end
                   <tr>
                    <td align="right" valign="top"> 团购图片：</td>
                    <td class="px10"><input type="file" name="gg_acc" id="gg_acc" />
                    最佳尺寸：463px*463px</td>
                  </tr>
                  <tr>
                     <td align="right" valign="top"> 商品总数：</td>
                     <td class="px10 message"><input name="gg_count" type="text" id="gg_count" style="height:25px;" value="$!obj.gg_count" size="40" />
                     商品总数请少于商品库存数</td>
                  </tr>
                  <tr>
                    <td align="right" valign="top">团购类别：</td>
                    <td class="px10 message">
                    <select name="gc_id" id="gc_id">
                    <option value="">请选择团购类别...</option>
                    #foreach($gc in $gcs)
                    <option value="$!gc.id">$!gc.gc_name</option>
                    #end
                    </select>
                    </td>
                  </tr>
                  <tr>
                    <td align="right" valign="top">所属区域：</td>
                    <td class="px10 message">
                    <select name="ga_id" id="ga_id">
                    <option value="">请选择团购区域...</option>
                    <option value="-1">全国</option>
                    #foreach($ga in $gas)
                    <option value="$!ga.id">$!ga.ga_name</option>
                    #end
                    </select></td>
                  </tr>
                  <tr>
                    <td align="right" valign="top"> 成团数量：</td>
                    <td class="px10 message">
                      <input name="gg_group_count" type="text" id="gg_group_count" style="height:25px;" value="$!obj.gg_group_count" size="40" />
                    </td>
                  </tr>
                  <tr>
                    <td align="right" valign="top">虚拟数量：</td>
                    <td class="px10 message">
                      <input name="gg_vir_count" type="text" id="gg_vir_count" style="height:25px;" value="$!obj.gg_vir_count" size="40" />
                  </td>
                  </tr>
                  <tr>
                    <td align="right" valign="top">限购数量：</td>
                    <td class="px10 message">
                      <input name="gg_max_count" type="text" id="gg_max_count" style="height:25px;" value="$!obj.gg_max_count" size="40" />
                      团购用户最大购买数量,为0时表示不限制
                   </td>
                  </tr>
                  <tr>
                    <td width="120" align="right" valign="top">团购简介：</td>
                    <td class="px10 message"><textarea name="gg_content" cols="40" rows="6" id="gg_content">$!obj.gg_content</textarea></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td class="px10"><label><input type="checkbox" name="gc_agree" id="gc_agree" />
                    我已阅读 <a href="$!webPath/doc_group.htm" target="_blank" style="color:#F60">团购服务协议</a> 并同意</label></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td class="px10"><span class="setsub">
                      <input name="提交" type="submit"  value="保存"  style="cursor:pointer;"/>
                      </span></td>
                  </tr>
                </table>
				</form>
          </div>
          </div></td>
      </tr>
    </table>
  </div>
  $!httpInclude.include("/footer.htm")
</div>
</body>
</html>
